package com.saftalk.ui;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;


public class UIPresenceListResult extends UIResult {
	
	private Map<Long, UIPresenceResult> presences;
	private Collection<UIPresenceResult> results;
	
	public UIPresenceListResult()
	{
		this.success = true;
		this.presences = new HashMap<Long, UIPresenceResult>();
	}
	
	public void addOrSet(UIPresenceResult result)
	{
		this.presences.put(result.getUserId(), result);
	}
	public UIPresenceResult get(Long userId) {
		return this.presences.get(userId);
	}
	
	public Collection<UIPresenceResult> list() {
		return presences.values();
	}
	
	public void fillResults() {
		results = list();
	}

}
